package ad.android.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ad.android.util.Constants;

/**
 * TblAdApplicationStatistics entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tbl_ad_application_statistics", catalog = Constants.CATALOG)
public class AdApplicationStatistics implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -7399143643016758765L;
	private Long id;
	private Application tblApplication;
	private Ad tblAd;
	private Integer downloadNum;
	private Integer clickNum;

	// Constructors

	/** default constructor */
	public AdApplicationStatistics() {
	}

	/** minimal constructor */
	public AdApplicationStatistics(Application tblApplication, Ad tblAd) {
		this.tblApplication = tblApplication;
		this.tblAd = tblAd;
	}

	/** full constructor */
	public AdApplicationStatistics(Application tblApplication,
			Ad tblAd, Integer downloadNum, Integer clickNum) {
		this.tblApplication = tblApplication;
		this.tblAd = tblAd;
		this.downloadNum = downloadNum;
		this.clickNum = clickNum;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "APPLICATION_ID", nullable = false)
	public Application getTblApplication() {
		return this.tblApplication;
	}

	public void setTblApplication(Application tblApplication) {
		this.tblApplication = tblApplication;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AD_ID", nullable = false)
	public Ad getTblAd() {
		return this.tblAd;
	}

	public void setTblAd(Ad tblAd) {
		this.tblAd = tblAd;
	}

	@Column(name = "DOWNLOAD_NUM")
	public Integer getDownloadNum() {
		return this.downloadNum;
	}

	public void setDownloadNum(Integer downloadNum) {
		this.downloadNum = downloadNum;
	}

	@Column(name = "CLICK_NUM")
	public Integer getClickNum() {
		return this.clickNum;
	}

	public void setClickNum(Integer clickNum) {
		this.clickNum = clickNum;
	}

}